import com.ynny.bean.Student;
import com.ynny.dao.StudentDaoImpl;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class StudentTest {
    public void StudentsTest() {
        ClassPathXmlApplicationContext context =
                new ClassPathXmlApplicationContext("spring.xml");
        StudentDaoImpl studentDao = context.getBean("studentDaoImpl", StudentDaoImpl.class);
        studentDao.insertStudent("20180101", "张三", "男", "计算机科学与技术", "2018");

        List<Student> students = studentDao.selectAll();
        for (Student student : students) {
            System.out.println(student);
        }
    }
}
